package mtg.collector.mtgc2.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

/**
 *
 * @author Eric Kisner
 */
public abstract class AbstractMTGModel {

    protected PropertyChangeSupport propertyChangeSupport;

    public AbstractMTGModel() {
        propertyChangeSupport = new PropertyChangeSupport( this );
    }

    public void addPropertyChangeListener( PropertyChangeListener listener ) {
        propertyChangeSupport.addPropertyChangeListener( listener );
    }

    public void removePropertyChangeListener( PropertyChangeListener listener ) {
        propertyChangeSupport.removePropertyChangeListener( listener );
    }

    protected void firePropertyChange( String propertyName, Object oldValue, Object newValue ) {
        propertyChangeSupport.firePropertyChange( propertyName, oldValue, newValue );
    }
}
